<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<script type="text/javascript" src='resources/js/global/global.ca.js'></script>

<script>
	
	$(function(){
		
		$("#box-search-tabs li").click(function(){
			$("#box-search-tabs li").removeClass("current").removeClass("active");
			if (!$(this).hasClass("active")) {
				$(this).addClass("active");
			}
			$(this).addClass("current");
			if ($(this).attr("id")) {
				$("#box-search-forms form").css("display", "none");
				$("#frm_" + $(this).attr("id")).css("display", "block");
			}
		});
		
		KX.sugg_init_skb_fr(10, "highlightg", "highlighth", "lh", "t_from", "container1", 1, "frm_cxzz");
		KX.sugg_init_skb_fr(10, "highlightg", "highlighth", "lh", "t_to", "container2", 1, "frm_cxzz");
		KX.sugg_init_skb_fr(10, "highlightg", "highlighth", "lh", "t_stationname", "container3", 1, "frm_cxcz");
		
		$.each($("#box-search-tabs li"), function(){
			$(this).click(function(){
				var frm_id = $(this).attr("id");
				if ($("#frm_" + frm_id).find("div[id^=container]").size() > 0) {
					$.each($("#frm_" + frm_id).find("div[id^=container]"), function(){
						if (!$(this).attr("stat") && $(this).attr("stat") != "adjusted") {
							// style adjusted against container
							if ($("#" + $(this).attr("alt")).size() > 0) {
								var left_h = $("#" + $(this).attr("alt")).offset().left;
								var left_p = $("#frm_" + frm_id).offset().left;
								if ($("#frm_" + frm_id).css("margin-left")) {
									left_h += parseInt($("#frm_" + frm_id).css("margin-left"));
								}
								$(this).css("left", (left_h - left_p) + "px").attr("stat", "adjusted");
							}
						}
					});
				}
			});
		});	

	});

</script>

<!-- Tabs -->
<div id="box-search-tabs">
	<ul>
		<li class="${search_vo != null ? (search_vo.trainSearchType eq '3' ? 'active current' : '') : 'active current'}" id="cxzz"><span>站站查询</span></li>
		<li class="${search_vo.trainSearchType eq '2' ? 'active current' : ''}" id="cxcz"><span>车站查询</span></li>
		<li class="${search_vo.trainSearchType eq '1' ? 'active current' : ''}" id="cxcc"><span>车次查询</span></li>
	</ul>
</div>
	
<div id="box-search-forms">
	<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td class="box_left"></td>
			<td class="box_top_c"></td>
			<td class="box_top_r"></td>
		</tr>
		<tr>
			<td class="box_left"></td>
			<td height="80px" valign="center" class="box_content">
				<div class="p">
					<form action="app/train/search" method="post" id="frm_cxzz" style="${search_vo != null ? (search_vo.trainSearchType eq '3' ? 'display:block' : 'display:none') : 'display:block'}">
						<div class="p">
							<span style="margin-right:15px">我要搜</span>
							<span>出发站: <input type="text" size="12" name="trainSearchVO.trainStationFrom" class="text" value="${search_vo.trainStationFrom}" id="t_from" /></span>
							<div id="container1" class="yui-ac-container-index" style="display: none;"><div class="yui-ac-content"><div class="yui-ac-head" style="display: block;">输入中文/拼音或↑↓选择</div><div class="yui-ac-body"><div id="1" class="lh ha highlighth"><div align="left"><div style="float: right;"></div><span class="cityname">北京</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="2" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">宝鸡</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="3" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">白涧</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="4" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">滨江</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="5" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京站</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="6" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京西</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>X)</div></div><div style="display: block;" id="7" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京北</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>B)</div></div><div style="display: block;" id="8" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">笔架山</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>S)</div></div><div style="display: block;" id="9" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">八角台</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>T)</div></div><div style="display: none;" id="10" class="lh ha">&nbsp;</div></div></div></div>
							<span style="margin-left:20px">到达站: <input type="text" size="12" name="trainSearchVO.trainStationTo" class="text" value="${search_vo.trainStationTo}" id="t_to" /></span>
							<div id="container2" class="yui-ac-container-index" style="display: none;"><div class="yui-ac-content"><div class="yui-ac-head" style="display: block;">输入中文/拼音或↑↓选择</div><div class="yui-ac-body"><div id="1" class="lh ha highlighth"><div align="left"><div style="float: right;"></div><span class="cityname">北京</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="2" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">宝鸡</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="3" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">白涧</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="4" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">滨江</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="5" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京站</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="6" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京西</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>X)</div></div><div style="display: block;" id="7" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京北</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>B)</div></div><div style="display: block;" id="8" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">笔架山</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>S)</div></div><div style="display: block;" id="9" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">八角台</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>T)</div></div><div style="display: none;" id="10" class="lh ha">&nbsp;</div></div></div></div>
							<input type="submit" value="站站查询" class="btn" />
						</div>
					</form>
					<form action="app/train/search" method="post" action="post" id="frm_cxcz" style="${search_vo.trainSearchType eq '2' ? 'display:block' : 'display:none'}">
						<div class="p">
							<span>输入车站名: <input type="text" size="12" name="trainSearchVO.trainStationName" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span>
							<div id="container3" class="yui-ac-container-index" style="display: none;"><div class="yui-ac-content"><div class="yui-ac-head" style="display: block;">输入中文/拼音或↑↓选择</div><div class="yui-ac-body"><div id="1" class="lh ha highlighth"><div align="left"><div style="float: right;"></div><span class="cityname">北京</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="2" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">宝鸡</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="3" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">白涧</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="4" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">滨江</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="5" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京站</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>)</div></div><div style="display: block;" id="6" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京西</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>X)</div></div><div style="display: block;" id="7" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">北京北</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>B)</div></div><div style="display: block;" id="8" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">笔架山</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>S)</div></div><div style="display: block;" id="9" class="lh ha"><div align="left"><div style="float: right;"></div><span class="cityname">八角台</span>&nbsp;(<span style="color: rgb(255, 102, 0);">BJ</span>T)</div></div><div style="display: none;" id="10" class="lh ha">&nbsp;</div></div></div></div>
							<input type="submit" value="车站查询" class="btn" />
						</div>
					</form>
					<form action="app/train/search" method="post" action="post" id="frm_cxcc" style="${search_vo.trainSearchType eq '1' ? 'display:block' : 'display:none'}">
						<div class="p">
							<span>输入车次: <input type="text" size="12" name="trainSearchVO.trainNumber" class="text" value="${search_vo.trainNumber}"/></span>
							<input type="submit" value="车次查询" class="btn" />
						</div>
					</form>
				</div>
			</td>
			<td class="box_right"></td>
		</tr>
		<tr>
			<td class="box_btm_l"></td>
			<td class="box_btm_c"></td>
			<td class="box_btm_r"></td>
		</tr>
	</table>
</div>